using UnityEngine;
using UnityEngine.UI;
using QFramework;
using UnityEngine.SceneManagement;
using ProjectSurvivor;

namespace QFrameworkSurvivor
{
	public class UIGameOverPanelData : UIPanelData
	{
	}
	public partial class UIGameOverPanel : UIPanel
	{
		protected override void OnInit(IUIData uiData = null)
		{
			mData = uiData as UIGameOverPanelData ?? new UIGameOverPanelData();
			Time.timeScale = 0;

            BtnBackToStart.onClick.AddListener(() =>
            {
                AudioKit.PlaySound("BtnClick");
                Time.timeScale = 1;
                this.CloseSelf();
                SceneManager.LoadScene("StartGame");
            });
        }
		
		protected override void OnOpen(IUIData uiData = null)
		{
		}
		
		protected override void OnShow()
		{
		}
		
		protected override void OnHide()
		{
		}
		
		protected override void OnClose()
		{
            Time.timeScale = 1;
        }
	}
}
